package com.yuanfeng.base.feign;


import com.yuanfeng.commoms.dto.oos.OssUploadUpdateParamDTO;
import com.yuanfeng.commoms.util.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

/**
 * @author Stranger
 * @date 2023/3/24 9:30
 */
@FeignClient(name = "mall-third-party", url = "http://localhost:8088")
public interface ThirdPartyServiceClient {

    /**
     * 上传图片或文档 base64 格式传输
     *
     * @param param
     * @return
     */
    @PostMapping("/web/oss/upload")
    ResponseResult uploadToOssBase64(@RequestBody OssUploadUpdateParamDTO param);



    /**
     * 上传图片或视频  文件 格式传输
     *
     * @return
     * @RequestParam file
     */
    @PostMapping(value = "/web/oss/uploadFile", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    ResponseResult uploadToOssFile(@RequestPart("file") MultipartFile file);

    /**
     * 平台端发送库存不足短信
     *
     * @param paraMap
     */
    @PostMapping("/sms/dealerReview")
    ResponseResult sendDealerReview(@RequestBody Map<String, String> paraMap);
}
